# 定义小票固定信息
order_number = "DH202311010001"
time = "2023-11-01 20:56:15"
cashier = "管理员"

# 接收用户输入的商品价格（根据案例中的商品数量和单价）
usb_price = float(input("请输入金士顿U盘8G的单价："))
tf_card_price = float(input("请输入胜创16GTF卡的单价："))
card_reader_price = float(input("请输入读卡器的单价："))
cable_price = float(input("请输入网线2米的单价："))

# 计算各商品金额（数量均为1）
usb_amount = usb_price * 1
tf_card_amount = tf_card_price * 1
card_reader_amount = card_reader_price * 1
cable_amount = cable_price * 1

# 计算总数、总额
total_count = 4
total_amount = usb_amount + tf_card_amount + card_reader_amount + cable_amount
discount_amount = total_amount
received = total_amount
change = 0.00

# 使用f-string格式化输出购物小票
receipt = f"""
........................................
单号: {order_number}
时间: {time}
........................................
名称          数量  单价    金额
金士顿U盘8G   1    {usb_price:.2f}  {usb_amount:.2f}
胜创16GTF卡   1    {tf_card_price:.2f}  {tf_card_amount:.2f}
读卡器        1    {card_reader_price:.2f}  {card_reader_amount:.2f}
网线2米       1    {cable_price:.2f}  {cable_amount:.2f}
........................................
总数: {total_count}        总额: {total_amount:.2f}
折后总额: {discount_amount:.2f}
实收: {received:.2f}      找零: {change:.2f}
收银: {cashier}
........................................
"""

print(receipt)